import { ethers } from "hardhat";
import type { DropERC721} from "../../types/contracts/nft-drop/main/DropErc721.sol/DropERC721";
import type { DropERC721__factory } from "../../types/factories/contracts/nft-drop/main/DropErc721.sol/DropERC721__factory";




export async function deployDropERC721Fixture(): Promise<{ dropERC721: DropERC721 }> {
  const signers = await ethers.getSigners();
  const admin = signers[0];

  const DropERC721Factory = await ethers.getContractFactory("DropERC721");



  // const defaultAdmin = "0x1234567890123456789012345678901234567890";
  // const name = "Crypto leo";
  // const symbol = "LEO";
  // const contractURI = "https://example.com/contract";
  // const trustedForwarders = ["0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13"];
  // const saleRecipient = "0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13";
  // const royaltyRecipient = "0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13";
  // const royaltyBps = 1000;
  // const platformFeeBps = 500;
  // const platformFeeRecipient = "0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13";

  // const args = [
  //   defaultAdmin,
  //   name,
  //   symbol,
  //   contractURI,
  //   trustedForwarders,
  //   saleRecipient,
  //   royaltyRecipient,
  //   royaltyBps,
  //   platformFeeBps,
  //   platformFeeRecipient
  // ];

//  const args = [
//   "0x1234567890123456789012345678901234567890",
//   "Crypto leo",
//   "LEO",
//   "https://example.com/contract",
//   ["0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13"],
//   "0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13",
//   "0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13",
//   1000,
//   500,
//   "0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13"
// ];

  const dropERC721 = await DropERC721Factory.connect(admin).deploy()
  await dropERC721.waitForDeployment();

 

//  升级合约,调用 initialize 函数并传递参数


  // await dropERC721.initialize(
  //   defaultAdmin,
  //   name,
  //   symbol,
  //   contractURI,
  //   trustedForwarders,
  //   saleRecipient,
  //   royaltyRecipient,
  //   royaltyBps,
  //   platformFeeBps,
  //   platformFeeRecipient
  // ); 



  
  // 调用 initialize 函数并传递参数
  // const aa = await dropERC721.connect(admin).symbol()
  // console.log(aa,"mmmmmmmmmmmmmmmmmmmmmmmmmmmmm")

  // expect(await  dropERC721.symbol()).to.equal(symbol);
  return { dropERC721 };
}
